using System;
using System.ServiceModel;
using MoneyTracking.Common;

namespace MoneyTracking.Service
{
    [ServiceContract]
    public interface IMoneyService
    {
        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginAddExpense(Expense expense, AsyncCallback callback, object state);
        
        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginUpdateExpense(Expense expense, AsyncCallback callback, object state);
        
        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginDeleteExpense(Expense expense, AsyncCallback callback, object state);
        
        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginGetExpenseByID(int expenseId, AsyncCallback callback, object state);
        
        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginAddCategory(Category category, AsyncCallback callback, object state);
        
        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginUpdateCategory(Category category, AsyncCallback callback, object state);
        
        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginDeleteCategory(Category category, AsyncCallback callback, object state);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginGetCategoryByID(int categoryId, AsyncCallback callback, object state);

        ServiceResponse EndAddExpense(IAsyncResult result);

        ServiceResponse EndUpdateExpense(IAsyncResult result);

        ServiceResponse EndDeleteExpense(IAsyncResult result);

        ServiceResponse EndGetExpenseByID(IAsyncResult result);

        ServiceResponse EndAddCategory(IAsyncResult result);

        ServiceResponse EndUpdateCategory(IAsyncResult result);

        ServiceResponse EndDeleteCategory(IAsyncResult result);

        ServiceResponse EndGetCategoryByID(IAsyncResult result);
    }
}